/* sfacct01.p - OPERATIONS ACCOUNTING REPORT                              */
/* Copyright 1986-2011 QAD Inc., Santa Barbara, CA, USA.                      */
/* All rights reserved worldwide.  This is an unpublished work.           */
/* $Id:: sfacct01.p 2366 2010-11-10 01:47:19Z zzh                          $: */
/* REVISION: 7.0      LAST MODIFIED: 03/09/91   BY: pma *F270*            */
/* Revision: 7.3      Last Modified: 08/03/92   By: mpp *G337*            */
/* Revision: 7.3      Last edit:     09/27/93   By: jcd *G337*            */
/*                                   08/27/94   By: bcm *GL66*            */
/* REVISION: 7.3      LAST MODIFIED: 09/15/94   by: slm *GM62*            */
/* REVISION: 7.3      LAST MODIFIED: 12/23/94   by: cpp *FT95*            */
/* REVISION: 7.2      LAST MODIFIED: 04/13/95   BY: ais *F0QF*            */
/* REVISION: 7.3      LAST MODIFIED: 08/02/95   BY: qzl *G0SH*            */
/* REVISION: 7.3      LAST MODIFIED: 02/09/96   BY: rvw *G1MW*            */
/* REVISION: 8.6      LAST MODIFIED: 10/14/97   BY: ays *K0YH*            */
/* REVISION: 8.6E     LAST MODIFIED: 02/23/98   BY: *L007* A. Rahane      */
/* REVISION: 8.6E     LAST MODIFIED: 10/04/98   BY: *J314* Alfred Tan     */
/* REVISION: 9.1      LAST MODIFIED: 10/01/99   BY: *N014* Vijaya Pakala  */
/* REVISION: 9.1      LAST MODIFIED: 03/24/00 BY: *N08T* Annasaheb Rahane */
/* REVISION: 9.1      LAST MODIFIED: 07/25/00 BY: *N0GQ* Mudit Mehta      */
/* Old ECO marker removed, but no ECO header exists *F0PN*                */
/* Revision: 1.11.1.6    BY: Katie Hilbert        DATE: 04/05/01  ECO: *P008* */
/* Revision: 1.11.1.7    BY: Vandna Rohira        DATE: 07/10/01  ECO: *M1DM* */
/* Revision: 1.11.1.9    BY: Paul Donnelly (SB)   DATE: 06/28/03  ECO: *Q00L* */
/* Revision: 1.11.1.10   BY: Kirti Desai          DATE: 01/07/04  ECO: *P1HZ* */
/* Revision: 1.11.1.11   BY: Jean Miller          DATE: 04/18/07  ECO: *R0C6* */
/* $Revision: 1.11.1.15 $   BY: Katie Hilbert        DATE: 04/24/08  ECO: *R0RX* */
/* $Revision: 1.11.1.15 $ BY: Chandrakant Ingale  DATE: 08/18/09 ECO: *Q377* */
/*-Revision end---------------------------------------------------------------*/

/******************************************************************************/
/* All patch markers and commented out code have been removed from the source */
/* code below. For all future modifications to this file, any code which is   */
/* no longer required should be deleted and no in-line patch markers should   */
/* be added.  The ECO marker should only be included in the Revision History. */
/******************************************************************************/

{us/mf/mfdtitle.i "99 "}
{us/wo/woconsdf.i}

define variable wonbr    like op_wo_nbr.
define variable wonbr1   like op_wo_nbr.
define variable wolot    like op_wo_lot.
define variable wolot1   like op_wo_lot.
define variable part     like op_part.
define variable part1    like op_part.
define variable altpart    like ptal_alt_part.
define variable altpart1   like ptal_alt_part.
define variable prodline  like wo_line.
define variable prodline1  like wo_line.
define variable shift      like op_shift.
define variable shift1     like op_shift.
define variable orderType as character format "x(9)" label "Include Repetitive/Discrete/Both" no-undo.
define variable order_type_key like lngd_key1 initial "0".
define variable c-lngd-dataset like lngd_dataset initial "wo_mstr".
define variable mfgtype   as character format "x(9)" no-undo.
define variable opwonbr   like op_wo_nbr column-label "Item Number!Production Order".
define variable typeglref    like opgl_gl_ref column-label "Mfg Type!GL Reference".
define variable trdate   like op_tran_date.
define variable trdate1  like op_tran_date.
define variable glref    like opgl_gl_ref.
define variable glref1   like opgl_gl_ref.
define variable efdate   like op_date.
define variable efdate1  like op_date.
define variable desc1    like pt_desc1.
define variable desc2    like pt_desc2 format "x(26)".
define variable oldtrnbr like op_trnbr format ">>>>>>>9".
define variable tr_yn    like mfc_logical label "Detail by Transaction"
   initial yes.
define variable gl_yn    like mfc_logical label "Detail by GL Account"
   initial yes.
define variable acct     like glt_acct.
define variable acct1    like glt_acct.
define variable sub      like glt_sub.
define variable sub1     like glt_sub.
define variable proj     like glt_project.
define variable proj1    like glt_project.
define variable cc       like glt_cc.
define variable cc1      like glt_cc.
define variable oplot    like op_wo_lot column-label "WO ID!Op".
define variable drcract  like glt_acct
   column-label "Dr Acct!Cr Acct" no-undo.
define variable subact   like glt_sub
   column-label "Sub-Acct!Sub-Acct" no-undo.
define variable ccdisp   like glt_cc
   column-label "CC!CC" no-undo.
define variable glrefid like glt_dy_num
   column-label "GL Reference!Reference ID" no-undo.

/* TEMP-TABLE DEFINITION OF tt_gltw_wkfl */
{us/sf/sfgltwdf.i new}

form
   part           colon 20
   part1          label "To" colon 49 skip
   wonbr          colon 20
   wonbr1         label "To" colon 49 skip
   wolot          colon 20
   wolot1         label "To" colon 49 skip
   prodline colon 20
   prodline1 label "To" colon 49 skip
   shift     colon 20
   shift1    label "To" colon 49 skip
   efdate         colon 20
   efdate1        label "To" colon 49 skip
   glref          colon 20
   glref1         label "To" colon 49 skip
   acct           colon 20
   acct1          label "To" colon 49 skip
   sub            colon 20
   sub1           label "To" colon 49 skip
   cc             colon 20
   cc1            label "To" colon 49 skip
   proj           colon 20
   proj1          label "To" colon 49 skip
   trdate         colon 20
   trdate1   label "To" colon 49 skip
   altpart   colon 20
   altpart1  label "To" colon 49 skip(1)
   orderType colon 35
   tr_yn          colon 35
   gl_yn          colon 35
with frame a side-labels          width 80.

/* SET EXTERNAL LABELS */
setFrameLabels(frame a:handle).

form
   op_date
   op_trnbr format ">>>>>>>9"
   op_wo_nbr
   oplot
   glrefid
   drcract
   subact
   ccdisp
   opgl_gl_amt format "->,>>>,>>>,>>9.99<<<<"
   with frame b width 132 down.

/* SET EXTERNAL LABELS */
setFrameLabels(frame b:handle).

for first lngd_det 
   where lngd_dataset = c-lngd-dataset
   and lngd_field   = "orderType"
   and lngd_lang    = global_user_lang
   and lngd_key1    = order_type_key
no-lock:
end.
if available lngd_det
   then
   orderType = lngd_key2.
else
   orderType = "".

{us/wb/wbrp02.i}
repeat:
   if part1   = hi_char
   then
      part1 = "".
   if wonbr1  = hi_char
   then
      wonbr1 = "".
   if wolot1  = hi_char
   then
      wolot1 = "".
   if trdate  = low_date
   then
      trdate = ?.
   if trdate1 = hi_date
   then
      trdate1 = ?.
   if efdate  = low_date
   then
      efdate = ?.
   if efdate1 = hi_date
   then
      efdate1 = ?.
   if glref1  = hi_char
   then
      glref1 = "".
   if acct1 = hi_char
   then
      acct1 = "".
   if sub1  = hi_char
   then
      sub1  = "".
   if cc1   = hi_char
   then
      cc1   = "".
   if proj1 = hi_char
   then
      proj1 = "".
   if altpart1 = hi_char
      then
      altpart1 = "".
   if shift1 = hi_char
      then
      shift1 = "".
   if prodline1 = hi_char
      then
      prodline1 = "".

   if c-application-mode <> 'web'
   then
      update
         part
         part1
         wonbr
         wonbr1
         wolot
         wolot1
         prodline
         prodline1
         shift
         shift1
         efdate
         efdate1
         glref
         glref1
         acct
         acct1
         sub
         sub1
         cc
         cc1
         proj
         proj1
         trdate
         trdate1
         altpart 
         altpart1
         orderType
         tr_yn
         gl_yn
      with frame a

      editing:
      if frame-field = "orderType" then do:
         {us/mf/mfnp05.i lngd_det lngd_det
            "lngd_dataset = c-lngd-dataset
              and lngd_field = 'orderType'
              and lngd_lang = global_user_lang"
            lngd_key2 "input orderType"}
         if recno <> ? then
            display lngd_key2 @ orderType with frame a.
      end.
      else do:
         status input.
         readkey.
         apply lastkey.
      end.
   end.

   {us/wb/wbrp06.i &command = update
             &fields = " part part1
                         wonbr wonbr1
                         wolot wolot1
                         prodline prodline1
                         shift shift1
                         efdate efdate1
                         glref glref1
                         acct acct1
                         sub sub1
                         cc cc1
                         proj proj1
                         trdate trdate1
                         orderType
                         altpart altpart1
                         tr_yn gl_yn    "
             &frm = "a"}

   if (c-application-mode <> 'web') or
      (c-application-mode = 'web' and
      (c-web-request begins 'data'))
   then do:

      bcdparm = "".
      {us/mf/mfquoter.i part           }
      {us/mf/mfquoter.i part1          }
      {us/mf/mfquoter.i wonbr          }
      {us/mf/mfquoter.i wonbr1         }
      {us/mf/mfquoter.i wolot          }
      {us/mf/mfquoter.i wolot1         }
      {us/mf/mfquoter.i prodline   }
      {us/mf/mfquoter.i prodline1   }
      {us/mf/mfquoter.i shift       }
      {us/mf/mfquoter.i shift1      }
      {us/mf/mfquoter.i efdate         }
      {us/mf/mfquoter.i efdate1        }
      {us/mf/mfquoter.i glref          }
      {us/mf/mfquoter.i glref1         }
      {us/mf/mfquoter.i acct           }
      {us/mf/mfquoter.i acct1          }
      {us/mf/mfquoter.i sub            }
      {us/mf/mfquoter.i sub1           }
      {us/mf/mfquoter.i cc             }
      {us/mf/mfquoter.i cc1            }
      {us/mf/mfquoter.i proj           }
      {us/mf/mfquoter.i proj1          }
      {us/mf/mfquoter.i trdate         }
      {us/mf/mfquoter.i trdate1        }
      {us/mf/mfquoter.i altpart }
      {us/mf/mfquoter.i altpart1}
      {us/mf/mfquoter.i orderType}
      {us/mf/mfquoter.i tr_yn          }
      {us/mf/mfquoter.i gl_yn          }

      if part1   = ""
      then
         part1 = hi_char.
      if wonbr1  = ""
      then
         wonbr1 = hi_char.
      if wolot1  = ""
      then
         wolot1 = hi_char.
      if trdate  = ?
      then
         trdate = low_date.
      if trdate1 = ?
      then
         trdate1 = hi_date.
      if efdate  = ?
      then
         efdate = low_date.
      if efdate1 = ?
      then
         efdate1 = hi_date.
      if glref1  = ""
      then
         glref1 = hi_char.
      if acct1  = ""
      then
         acct1  = hi_char.
      if sub1   = ""
      then
         sub1   = hi_char.
      if cc1    = ""
      then
         cc1    = hi_char.
      if proj1  = ""
      then
         proj1  = hi_char.
      if altpart1 = ""
         then
         altpart1 = hi_char.
      if shift1 = ""
         then
         shift1 = hi_char.
      if prodline1 = ""
         then
         prodline1 = hi_char.
   end. /* IF (c-application-mode <> 'web') OR */

   for first lngd_det 
    where lngd_dataset = c-lngd-dataset
      and lngd_field   = "orderType"
      and lngd_lang    = global_user_lang
      and lngd_key2   = orderType
   no-lock:
   end.
   if not available lngd_det
   then do:
      /* MUST BE Repetitive or Discrete or Both. */
      {us/bbi/pxmsg.i &MSGNUM=10346 &ERRORLEVEL=4}
      if c-application-mode = "WEB"
         then
         return.
      else
      next-prompt
         orderType with frame a.
      undo,retry.
   end.
   order_type_key = lngd_key1.

   /* OUTPUT DESTINATION SELECTION */
   {us/gp/gpselout.i &printType = "printer"
               &printWidth = 132
               &pagedFlag = " "
               &stream = " "
               &appendToFile = " "
               &streamedOutputToTerminal = " "
               &withBatchOption = "yes"
               &displayStatementType = 1
               &withCancelMessage = "yes"
               &pageBottomMargin = 6
               &withEmail = "yes"
               &withWinprint = "yes"
               &defineVariables = "yes"}
   {us/bbi/mfphead.i}

   form header
      skip(1)
   with frame a1 page-top width 80.
   view frame a1.

   /* DELETING RECORDS FROM tt_gltw_wkfl */
   for each tt_gltw_wkfl
      exclusive-lock:
      delete tt_gltw_wkfl.
   end. /* FOR EACH tt_gltw_wkfl */

   /* USING CORRECT INDEX BASED ON THE SELECTION CRITERIA  */
   /* ENTERED FOR IMPROVEMENT IN PERFORMANCE. THE DEFAULT  */
   /* INDEX USED WILL BE op_date IF NONE OF THE BELOW      */
   /* CONDITIONS GET SATISFIED                             */

   if  efdate  <> low_date
   and efdate1 <> hi_date
   then
      run process-use-op-date.
   else
   if  wolot  <> ""
   and wolot1 <> hi_char
   then
      run process-use-op-lot-op.
   else
   if  wonbr  <> ""
   and wonbr1 <> hi_char
   then
      run process-use-op-wo-nbr.
   else
   if  part  <> ""
   and part1 <> hi_char
   then
      run process-use-op-part.
   else
      run process-use-op-date.

   /* PRINT GL DISTRIBUTION */
   if gl_yn then do:
      if tr_yn then page.
      /* USING tt_gltw_wkfl TO PRINT THE REPORT  */
      {us/bbi/gprun.i ""sfglrp.p""}
   end. /* IF gl_yn */

   /* REPORT TRAILER */
   {us/mf/mfrtrail.i}

end. /* REPEAT */

{us/wb/wbrp04.i &frame-spec = a}

PROCEDURE process-use-op-date:

   define variable l_optrnbr like op_trnbr no-undo.

   l_optrnbr = 0.

   for each op_hist
         where op_hist.op_domain = global_domain 
         and (  (op_date      >= efdate
         and    op_date      <= efdate1)
         and   (op_wo_nbr    >= wonbr
         and    op_wo_nbr    <= wonbr1)
         and   (op_wo_lot    >= wolot
         and    op_wo_lot    <= wolot1)
         and   (op_tran_date >= trdate
         and    op_tran_date <= trdate1)
         and   (op_part      >= part
         and    op_part      <= part1)
         and   (op_line   <= prodline1
         and    op_line   >= prodline)
         and   (op_shift  <= shift1
         and    op_shift  >= shift)
         and ((altpart = "" and altpart1 = hi_char)
         or can-find(first ptal_mstr where ptal_mstr.ptal_domain = global_domain
         and ptal_part             = op_part
         and ptal_alt_part         >= altpart
         and ptal_alt_part         <= altpart1
         and ptal_active))
         and (order_type_key = {&MFG_TYPE_DISCRETE_AND_REPETITIVE}
         or can-find(first wo_mstr where wo_mstr.wo_domain = global_domain
         and wo_lot            = op_wo_lot
         and (wo_mfg_type = order_type_key)))
         ) no-lock
   use-index op_date,
       each opgl_det no-lock
       where opgl_domain = global_domain
         and (opgl_trnbr    = op_trnbr
         and (opgl_gl_ref  >= glref and opgl_gl_ref  <= glref1)
         and ((opgl_dr_acct >= acct and opgl_dr_acct <= acct1)
          or  (opgl_cr_acct >= acct and opgl_cr_acct <= acct1))
         and ((opgl_dr_sub  >= sub  and opgl_dr_sub  <= sub1)
          or  (opgl_cr_sub  >= sub  and opgl_cr_sub  <= sub1))
         and ((opgl_dr_cc   >= cc   and opgl_dr_cc   <= cc1)
          or  (opgl_cr_cc   >= cc   and opgl_cr_cc   <= cc1))
         and ((opgl_dr_proj >= proj and opgl_dr_proj <= proj1)
          or  (opgl_cr_proj >= proj and opgl_cr_proj <= proj1))
          and  (opgl_gl_amt   <> 0))
   by op_date by op_trnbr with frame b width 132 no-box:

      glrefid   = opgl_dy_num.

      /* CREATING tt_gltw_wkfl RECORDS WHEN gl_yn = YES */
      /* AND PRINTING THE REPORT WHEN tr_yn = YES       */
      {us/sf/sfacct1a.i}

   end. /* FOR EACH op_hist */

END PROCEDURE. /* process-use-op-date */


PROCEDURE process-use-op-lot-op:

   define variable l_optrnbr like op_trnbr no-undo.

   l_optrnbr = 0.

   for each op_hist
         where op_hist.op_domain = global_domain 
         and (  (op_wo_lot    >= wolot
         and    op_wo_lot    <= wolot1)
         and   (op_wo_nbr    >= wonbr
         and    op_wo_nbr    <= wonbr1)
         and   (op_date      >= efdate
         and    op_date      <= efdate1)
         and   (op_tran_date >= trdate
         and    op_tran_date <= trdate1)
         and   (op_part      >= part
         and    op_part      <= part1)
         and   (op_line   <= prodline1
         and    op_line   >= prodline)
         and   (op_shift  <= shift1
         and    op_shift  >= shift)
         and ((altpart = "" and altpart1 = hi_char)
         or can-find(first ptal_mstr where ptal_mstr.ptal_domain = global_domain
         and ptal_part             = op_part
         and ptal_alt_part         >= altpart
         and ptal_alt_part         <= altpart1
         and ptal_active))
         and (order_type_key = "0"
         or can-find(first wo_mstr where wo_mstr.wo_domain = global_domain
         and wo_lot            = op_wo_lot
         and (wo_type="c"
         or (order_type_key="1" and wo_mfg_type = "1" and wo_type =""))))
         ) no-lock
   use-index op_lot_op,
       each opgl_det no-lock
       where opgl_domain = global_domain
         and (opgl_trnbr = op_trnbr
         and (opgl_gl_ref  >= glref and opgl_gl_ref  <= glref1)
         and ((opgl_dr_acct >= acct and opgl_dr_acct <= acct1)
          or  (opgl_cr_acct >= acct and opgl_cr_acct <= acct1))
         and ((opgl_dr_sub  >= sub  and opgl_dr_sub  <= sub1)
          or  (opgl_cr_sub  >= sub  and opgl_cr_sub  <= sub1))
         and ((opgl_dr_cc   >= cc   and opgl_dr_cc   <= cc1)
          or  (opgl_cr_cc   >= cc   and opgl_cr_cc   <= cc1))
         and ((opgl_dr_proj >= proj and opgl_dr_proj <= proj1)
          or  (opgl_cr_proj >= proj and opgl_cr_proj <= proj1))
         and  (opgl_gl_amt   <> 0))
   by op_date by op_trnbr with frame b width 132 no-box:

      glrefid   = opgl_dy_num.

      /* CREATING  tt_gltw_wkfl RECORDS WHEN gl_yn = YES */
      /* AND PRINTING THE REPORT WHEN tr_yn = YES        */
      {us/sf/sfacct1a.i}

   end. /* FOR EACH op_hist */

END PROCEDURE. /* process-use-op-lot-op */


PROCEDURE process-use-op-wo-nbr:

   define variable l_optrnbr like op_trnbr no-undo.

   l_optrnbr = 0.

   for each op_hist
         where op_hist.op_domain = global_domain 
         and (  (op_wo_nbr    >= wonbr
         and    op_wo_nbr    <= wonbr1)
         and   (op_wo_lot    >= wolot
         and    op_wo_lot    <= wolot1)
         and   (op_date      >= efdate
         and    op_date      <= efdate1)
         and   (op_tran_date >= trdate
         and    op_tran_date <= trdate1)
         and   (op_part      >= part
         and    op_part      <= part1)
         and   (op_line   <= prodline1
         and    op_line   >= prodline)
         and   (op_shift  <= shift1
         and    op_shift  >= shift)
         and ((altpart = "" and altpart1 = hi_char)
         or can-find(first ptal_mstr where ptal_mstr.ptal_domain = global_domain
         and ptal_part             = op_part
         and ptal_alt_part         >= altpart
         and ptal_alt_part         <= altpart1
         and ptal_active))
         and (order_type_key = "0"
         or can-find(first wo_mstr where wo_mstr.wo_domain = global_domain
         and wo_lot            = op_wo_lot
         and (wo_type="c"
         or (order_type_key="1" and wo_mfg_type = "1" and wo_type =""))))
         ) no-lock
   use-index op_wo_nbr,
      each opgl_det no-lock
     where opgl_domain = global_domain
       and (opgl_trnbr = op_trnbr
       and (opgl_gl_ref  >= glref and opgl_gl_ref  <= glref1)
       and ((opgl_dr_acct >= acct and opgl_dr_acct <= acct1)
        or  (opgl_cr_acct >= acct and opgl_cr_acct <= acct1))
       and ((opgl_dr_sub  >= sub  and opgl_dr_sub  <= sub1)
        or  (opgl_cr_sub  >= sub  and opgl_cr_sub  <= sub1))
       and ((opgl_dr_cc   >= cc   and opgl_dr_cc   <= cc1)
        or  (opgl_cr_cc   >= cc   and opgl_cr_cc   <= cc1))
       and ((opgl_dr_proj >= proj and opgl_dr_proj <= proj1)
        or  (opgl_cr_proj >= proj and opgl_cr_proj <= proj1))
       and (opgl_gl_amt   <> 0))
   by op_date by op_trnbr with frame b width 132 no-box:

      glrefid   = opgl_dy_num.

      /* CREATING tt_gltw_wkfl RECORDS WHEN gl_yn = YES */
      /* AND PRINTING THE REPORT WHEN tr_yn = YES        */
      {us/sf/sfacct1a.i}

   end. /* FOR EACH op_hist */

END PROCEDURE. /* process-use-op-wo-nbr */


PROCEDURE process-use-op-part:

   define variable l_optrnbr like op_trnbr no-undo.

   l_optrnbr = 0.

   for each op_hist
         where op_hist.op_domain = global_domain 
         and (  (op_part      >= part
         and    op_part      <= part1)
         and   (op_wo_nbr    >= wonbr
         and    op_wo_nbr    <= wonbr1)
         and   (op_wo_lot    >= wolot
         and    op_wo_lot    <= wolot1)
         and   (op_date      >= efdate
         and    op_date      <= efdate1)
         and   (op_tran_date >= trdate
         and    op_tran_date <= trdate1)
         and   (op_line   <= prodline1
         and    op_line   >= prodline)
         and   (op_shift  <= shift1
         and    op_shift  >= shift)
         and ((altpart = "" and altpart1 = hi_char)
         or can-find(first ptal_mstr where ptal_mstr.ptal_domain = global_domain
         and ptal_part             = op_part
         and ptal_alt_part         >= altpart
         and ptal_alt_part         <= altpart1
         and ptal_active))
         and (order_type_key = {&MFG_TYPE_DISCRETE_AND_REPETITIVE}
         or can-find(first wo_mstr where wo_mstr.wo_domain = global_domain
         and wo_lot            = op_wo_lot
         and (wo_mfg_type= order_type_key )))
         ) no-lock
   use-index op_part,
      each opgl_det no-lock
     where opgl_domain = global_domain
       and (opgl_trnbr    = op_trnbr
       and (opgl_gl_ref  >= glref and opgl_gl_ref  <= glref1)
       and ((opgl_dr_acct >= acct and opgl_dr_acct <= acct1)
        or  (opgl_cr_acct >= acct and opgl_cr_acct <= acct1))
       and ((opgl_dr_sub  >= sub  and opgl_dr_sub  <= sub1)
        or  (opgl_cr_sub  >= sub  and opgl_cr_sub  <= sub1))
       and ((opgl_dr_cc   >= cc   and opgl_dr_cc   <= cc1)
        or  (opgl_cr_cc   >= cc   and opgl_cr_cc   <= cc1))
       and ((opgl_dr_proj >= proj and opgl_dr_proj <= proj1)
        or  (opgl_cr_proj >= proj and opgl_cr_proj <= proj1))
       and (opgl_gl_amt   <> 0))
   by op_date by op_trnbr with frame b width 132 no-box:

      glrefid   = opgl_dy_num.

      /* CREATING tt_gltw_wkfl RECORDS WHEN gl_yn = YES */
      /* AND PRINTING THE REPORT WHEN tr_yn = YES       */
      {us/sf/sfacct1a.i}

   end. /* FOR EACH op_hist */

END PROCEDURE. /* process-use-op-part */
